<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>修改响应式数组</title>
</head>

<body>
    <div class="app">
        <ul>
            <li v-for='(item,index) in arr'>{{item}}</li>
        </ul>
        <p>{{obj.uname}}</p>
        <p>{{obj.age}}</p>
        <p>{{obj.gender}}</p>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        var xm = new Vue({
            el: '.app',
            data: {
                arr: ['pear', 'banana', 'apple'],
                obj: {
                    uname: 'ls',
                    age: 8,
                }
            },
            methods: {
            }

        })
        Vue.set(xm.arr, 2, 'lemon')
        xm.$set(xm.arr, 1, 'orange')
        xm.$set(xm.obj, 'gender', 'male')

    </script>
</body>

</html>